<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div th:include="login::nav">
</div>
<br>
<div style="display: flex">
<div style="flex:1"><!--uid,uname,phone,pic-->
    <table border="2">
        <tr>
            <th>ID</th>
            <th>老师名称</th>
            <th>老师手机号</th>
            <th>班级编号</th>
            <th>图片</th>
            <td>操作</td>
        </tr>
        <tr th:each="x:${user}">
            <td th:text="${x.uid}"></td>
            <td  th:text="${x.uname}"></td>
            <td  th:text="${x.phone}"></td>
            <td th:text="${x.clzno}"></td>
            <td>
                <!-- vw屏幕宽度 100vw-->
                <div style="width: 10vw;height: 10vw">
                    <img style="width: 100%;height: 100%" th:src="'/admtea/showimg/'+${x.pic}"/>
                </div>
            </td>
            <td><a th:href="'/admtea/go2update?uid='+${x.uid}">修改</a></td>
            <td><a th:href="'/admtea/del?uid='+${x.uid}">删除</a></td>
        </tr>
    </table>
</div>
<div style="flex:1">
    <button><a href="/admtea/go2add">添加一位教师</a></button>
    <hr>
    <div th:if="${action}=='add'">
    <form action="/admtea/add" method="post" enctype="multipart/form-data">
        <h2>添加教师</h2>
        编号:<input name="uid"  type="text"><br>
        名称:<input name="uname" type="text"><br>
        电话:<input name="phone" type="text"><br>
        密码:<input name="pwd"  type="text"><br>
        图片:<input name="pic" type="file"  /><br>
        <input type="submit" />
    </form>
    </div>
    <div th:if="${action}==update" >
        <form action="/admtea/update" method="post" enctype="multipart/form-data" th:each="x:${userp}">
            <h2>修改教师</h2>
            编号:<input name="uid"  type="text" th:value="${x.uid}"><br>
            名称:<input name="uname" type="text" th:value="${x.uname}"><br>
            电话:<input name="phone" type="text" th:value="${x.phone}"><br>
            密码:<input name="pwd"  type="text"  th:value="${x.pwd}"><br>
            <tr >
                <div style="width: 10vw;height: 10vw">
                    <img style="width: 100%;height: 100%" th:src="'/admtea/showimg/'+${x.pic}"/>
    </div>
            </tr>
            图片:<input name="pic" type="file" th:value="${pic}" /><br>
            <input type="submit" />
        </form>
    </div>
</div>
</div>
</body>
</html>